package com.zykj.config.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhoulj(周利军) [1217102780@qq.com]
 * @Title: ConfigController
 * @Project: ${MODEL_NAME}
 * @Module ID:   <(模块)类编号，可以引用系统设计中的类编号>
 * @Comments: <对此类的描述，可以引用系统设计中的描述>
 * @JDK version used:      <JDK1.8> 20
 * @since 2018/12/24-11:20
 */
@RefreshScope
@RestController
@RequestMapping("config")
public class ConfigController {
    Logger logger = LoggerFactory.getLogger(ConfigController.class);
    @Value("${demo.age}")
    String age;
    @Value("${person.address}")
    String address;
    @Value("${demo.name}")
    String name;

    @RequestMapping
    public String index() {
        logger.debug(String.format("name:%s, address:%s, 年龄: %s", name,address,age));

        return  "Info:"+String.format("name:%s, address:%s, 年龄: %s", name,address,age);
    }



}
